<div class="evaluations view">
<h2><?php  echo __('Evaluación'); ?></h2>
	<dl>
		<dt><?php echo __('Id'); ?></dt>
		<dd>
			<?php echo h($evaluation['Evaluation']['id']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Institución'); ?></dt>
		<dd>
			<?php echo $this->Html->link($evaluation['Institution']['nombre'], array('controller' => 'institutions', 'action' => 'view', $evaluation['Institution']['id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Grupo'); ?></dt>
		<dd>
			<?php echo $this->Html->link($evaluation['Group']['name'], array('controller' => 'groups', 'action' => 'view', $evaluation['Group']['id'])); ?>
			&nbsp;
		</dd>		
		<dt><?php echo __('Avance'); ?></dt>
		<dd>
			<?php echo $this->Html->link($evaluation['Preview']['name'], array('controller' => 'previews', 'action' => 'view', $evaluation['Preview']['id'])); ?>
			&nbsp;
		</dd>

		<dt><?php echo __('Evaluador'); ?></dt>
		<dd>
			<?php echo $this->Html->link($evaluation['User']['nombres'], array('controller' => 'users', 'action' => 'view', $evaluation['User']['id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Plantilla'); ?></dt>
		<dd>
			<?php echo $this->Html->link($evaluation['Plantilla']['titulo'], array('controller' => 'plantillas', 'action' => 'view', $evaluation['Plantilla']['id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Comentario'); ?></dt>
		<dd>
			<?php echo h($evaluation['Evaluation']['comentario']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Nota Final'); ?></dt>
		<dd>
			<?php echo h($evaluation['Evaluation']['nota']); ?>
			&nbsp;
		</dd>
	</dl>
	<div class="related">
	<h3><?php echo __('Criterios'); ?></h3>
	<?php if (!empty($evaluation['Criterio'])): ?>
	<table cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php echo __('Tipo'); ?></th>
		<th><?php echo __('Criterio'); ?></th>
		<th><?php echo __('Puntaje'); ?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($evaluation['Criterio'] as $criterio): ?>
		<tr>
			<td><?php echo $criterio['tipo']; ?></td>
			<td><?php echo $criterio['criterio']; ?></td>
			<td><?php	$contar=0;
			foreach ($criteriosEvaluations as $nota):
				if($nota['CriteriosEvaluation']['criterio_id']==$criterio['id']):
					echo $nota['CriteriosEvaluation']['puntaje'];
				endif;

			endforeach; ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>
</div>
</div>
<div class="actions">
	<h3><?php echo __('Actions'); ?></h3>
	<ul>
	<?php if($this->Session->read('Auth.User.role_id')=='1'): ?>	
		<li><?php echo $this->Html->link(__('Editar Evaluacin'), array('action' => 'edit', $evaluation['Evaluation']['id'])); ?> </li>
		<li><?php echo $this->Form->postLink(__('Eliminar Evaluación'), array('action' => 'delete', $evaluation['Evaluation']['id']), null, __('Are you sure you want to delete # %s?', $evaluation['Evaluation']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Evaluaciones'), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Plantillas'), array('controller' => 'plantillas', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nueva Plantilla'), array('controller' => 'plantillas', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Listar Criterios'), array('controller' => 'criterios', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nuevo Criterio'), array('controller' => 'criterios', 'action' => 'add')); ?> </li>
		<?php endif; ?>
		<?php if($this->Session->read('Auth.User.role_id')=='6'): ?>	
		<li><?php echo $this->Html->link(__('Mis evaluaciones'), array('controller' => 'evaluations', 'action' => 'index')); ?> </li>
		<?php endif; ?>
	</ul>
</div>

